#ifndef __AS608_H
#define __AS608_H

#define TOUCH_PIN GPIO_NUM_13
#define USER_UART UART_NUM_2
#define USER_TX GPIO_NUM_4
#define USER_RX GPIO_NUM_5
#define SUCCESS 1
#define FAIL    0
#define AS608_ADDR  0xffffffff



typedef struct SearchResult
{
    uint16_t PageID;
    uint16_t MatchScore;
}SearchResult_t;

void LED_PinSet();

void User_Uart2_Init(int baud_rate);
void Touch_PinSet();
void Uart_SendHead();
void Uart_SendAddr();
void Uart_Sendflag(uint8_t flag);
void Uart_Sendlenth(uint16_t lenth);
void Uart_Sendcmd(uint8_t cmd);
void Uart_Sendcheck(uint16_t check);
uint8_t * MY_Judge(int waittime);
uint8_t AS608_GetImage();
uint8_t AS608_GenChar(uint8_t BufferID);
uint8_t AS608_Match();
uint8_t AS608_RegModel();
uint8_t AS608_StoreChar(uint8_t BufferID,uint16_t PageID);
uint8_t AS608_Search(uint8_t BufferID,uint16_t StartPage,uint16_t PageNum,SearchResult_t *result);
uint8_t AS608_DeleteChar(uint16_t PageID,uint16_t num);
uint8_t Judge_FingerPress();
uint8_t Fingerprint_Register(uint16_t ID);
uint8_t Fingerprint_Search(SearchResult_t * SearchResult);


#endif